Skip to content

feat(api): add HTTP/2 connection keepalive to ClientTrafficPolicy#8213

Closed
rajatvig wants to merge 5 commits intoenvoyproxy:mainfrom
rajatvig:feature/http2-client-keepalive
Closed

feat(api): add HTTP/2 connection keepalive to ClientTrafficPolicy#8213
rajatvig wants to merge 5 commits intoenvoyproxy:mainfrom
rajatvig:feature/http2-client-keepalive

Conversation

@rajatvig
Copy link
Contributor

@rajatvig rajatvig commented Feb 8, 2026

What this PR does / why we need it

Adds HTTP/2 connection keepalive configuration to ClientTrafficPolicy.

Which issue(s) this PR fixes

Fixes #7744

Release Notes: Yes

@netlify
Copy link

netlify bot commented Feb 8, 2026

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 311a277
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/698932584df27300088717af
😎 Deploy Preview https://deploy-preview-8213--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Signed-off-by: Rajat Vig <rvig@etsy.com>
@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.83%. Comparing base (5c2075b) to head (311a277).
⚠️ Report is 27 commits behind head on main.

Files with missing lines Patch % Lines
internal/gatewayapi/http.go 65.62% 4 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8213      +/-   ##
==========================================
+ Coverage   73.81%   73.83%   +0.01%     
==========================================
  Files         241      241              
  Lines       36608    36651      +43     
==========================================
+ Hits        27021    27060      +39     
+ Misses       7681     7678       -3     
- Partials     1906     1913       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rajatvig rajatvig marked this pull request as ready for review February 8, 2026 23:21
@rajatvig rajatvig requested a review from a team as a code owner February 8, 2026 23:21
Comment on lines +455 to +463
// Interval specifies how often to send HTTP/2 PING frames to keep the connection alive.
// If not set, PING frames will not be sent periodically.
// +optional
Interval *gwapiv1.Duration `json:"interval,omitempty"`

// Timeout specifies how long to wait for a PING response before considering the connection dead.
// If not set, a default timeout is used.
// +optional
Timeout *gwapiv1.Duration `json:"timeout,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs validation that timeout < interval

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we validate timeout < interval with CEL so this can be checked eariler?

Signed-off-by: Rajat Vig <rvig@etsy.com>
Signed-off-by: Rajat Vig <rvig@etsy.com>
if err != nil {
errs = errors.Join(errs, fmt.Errorf("invalid ConnectionKeepalive.Interval: %w", err))
} else {
keepalive.Interval = ptr.To(uint32(d.Seconds()))
Copy link
Member

@zhaohuabing zhaohuabing Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API allows ms, but the translation drops ms. Should we use metav1.Duration here?

Then envoy api does allows ms: https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/protocol.proto#envoy-v3-api-msg-config-core-v3-keepalivesettings

It's fine for TCP keepalive to use seconds only, since the API only allows seconds:
https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/address.proto#config-core-v3-tcpkeepalive

// Timeout specifies how long to wait for a PING response before considering the connection dead.
// If not set, a default timeout is used.
// +optional
Timeout *gwapiv1.Duration `json:"timeout,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we document the default timeout value in the API docs?

@rajatvig
Copy link
Contributor Author

Closing this for #8215

@rajatvig rajatvig closed this Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Enhancement: Http2 keep alive probes

3 participants